package com.tjetc.dao;

import com.tjetc.domain.Park;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ParkMapper {

    int insert(Park record);

    @Select("select * from park where description=#{description}")
    Park getByDescription(String description);

    @Delete("delete from park where park_id=#{id}")
    int deleteById(int id);

    @Select("select * from park;")
    List<Park> list();

    @Select("select * from park where park_id=#{id}")
    Park getById(int id);

    @Update("update park set description = #{description} where park_id=#{parkId};")
    int update(Park park);
}